﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WeMakeSP.WebComponents.RSSAdvancedReaderWebPart
{
    /// <summary>
    /// The event arguments for the feed refresh.
    /// </summary>
    public class FeedRefreshEventArgs
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="FeedRefreshEventArgs"/> class.
        /// </summary>
        /// <param name="feedUrl">The feed URL.</param>
        public FeedRefreshEventArgs(string feedUrl)
            : this(feedUrl, 0)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FeedRefreshEventArgs"/> class.
        /// </summary>
        /// <param name="feedUrl">The feed URL.</param>
        /// <param name="itemCount">The item count.</param>
        public FeedRefreshEventArgs(string feedUrl, int itemCount)
        {
            // Guard.

            if (String.IsNullOrEmpty(feedUrl))
            {
                throw new ArgumentNullException("feedUrl");
            }

            // Set the feed url.

            this.FeedUrl = feedUrl;

            // Set the item count.

            this.ItemCount = itemCount;
        }

        #endregion

        #region Propeties

        /// <summary>
        /// Gets the feed URL.
        /// </summary>
        /// <value>The feed URL.</value>
        public string FeedUrl
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the item count.
        /// </summary>
        /// <value>The item count.</value>
        public int ItemCount
        {
            get;
            private set;
        }

        #endregion
    }
}
